# 计算n的阶乘
# def fact(n):
#     if n == 0:
#         return 1
#     else:
#         return n*fact(n-1)
#
#
# # print(fact(10))
#
#
# # 字符串反转
# def rvs(s):
#     if s == "":
#         return s
#     else:
#         return rvs(s[1:])+s[0]
#
#
# # print(rvs("code"))
#
#
# # 斐波那契数列实现
# def f(n):
#     if n == 1:
#         return 1
#     elif n == 2:
#         return 1
#     else:
#         return f(n-1)+f(n-2)
#
#
# # print(f(20))
#
#
# # 汉诺塔
# count = 1
# def hanoi(n, src, dst, mid):
#     global count
#     if n == 1:
#         print("{}:{}->{}".format(1, src, dst))
#         count += 1
#     else:
#         hanoi(n-1, src, mid, dst)
#         print("{}:{}->{}".format(n, src, dst))
#         count += 1
#         hanoi(n-1, mid, dst, src)


# hanoi(6, "A", "C", "B")

# 科赫雪花绘制

import turtle


def koch(size, n):
    if n == 0:
        turtle.fd(size)
    else:
        for angle in [0, 60, -120, 60]:
            turtle.left(angle)
            koch(size/3, n-1)


def main():
    turtle.setup(800, 800)
    turtle.speed(10)
    turtle.penup()
    turtle.goto(-300, 170)
    turtle.pendown()
    turtle.pensize(5)
    level = 3
    koch(600, level)
    turtle.right(120)
    koch(600, level)
    turtle.right(120)
    koch(600, level)
    turtle.hideturtle()
    turtle.exitonclick()


# main()


def cmul(a, *b):
    num = a
    for i in b:
        num *= i
    return num


# print(eval("cmul({})".format(input())))




